/********************************************/
// Creation History
// --------------------------------------------------------------
//	Company:			HTHK
//	NAME:				RestirctProcess.java
//    Title   :			some operations about Restirct such as
//                        CreateBean,Insert,Update,Delete,Find  
//	FUNCTION:			
//	BY:					Jet Tao
//	DATE:				28/08/2003
// --------------------------------------------------------------
/*********************************************/

package tss.restrict;

import java.sql.Connection;
import java.util.Vector;

import com.ffpc.sql.BaseSqlCommand;
import com.ffpc.sql.Column;
import com.ffpc.sql.DataException;

/**
 * A Class class.
 * <P>
 * 
 * @author HTHK
 */
public class RestrictProcess {
	public static RestrictBean createBean() {
		return new Restrict();
	}

	public static RestrictBean[] find(Connection con, RestrictBean RestrictBean)
			throws DataException {
		Restrict Restrict = (Restrict) RestrictBean;
		BaseSqlCommand buc = new BaseSqlCommand(con);
		Vector rows = buc.find(Restrict);
		Restrict[] beans = new Restrict[rows.size()];
		for (int i = 0; i < rows.size(); i++) {
			Restrict bean = new Restrict();
			bean.setColumns((Column[]) rows.get(i));
			beans[i] = bean;
		}
		return beans;
	}

	public static int update(Connection con, RestrictBean RestrictBean)
			throws DataException {
		Restrict Restrict = (Restrict) RestrictBean;
		Restrict.setConnection(con);
		return Restrict.update();
	}
}
